package com.huang.edustatistics.controller;


import com.huang.edustatistics.client.UcenterClient;
import com.huang.edustatistics.service.StatisticsDailyService;
import com.hunag.utils.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

/**
 * <p>
 * 网站统计日数据 前端控制器
 * </p>
 *
 * @author testjava
 * @since 2021-04-04
 */
@RestController
@RequestMapping("/staservice/statistics-daily")
public class StatisticsDailyController {
    @Autowired
    private StatisticsDailyService dailyService;


    @PostMapping("registerCount/{day}")
    public R registerCount(@PathVariable String day) {
        dailyService.getRegisterNum(day);
        return R.ok();
    }

    //图标展示只需要给前台传入  时间和数量即可
    @GetMapping("showData/{type}/{begin}/{end}")
    public R showData(@PathVariable String type,
                      @PathVariable String begin,
                      @PathVariable String end) {
        Map<String, Object> map = dailyService.showData(type, begin, end);
        return R.ok().data(map);

    }

}

